package javaBase.nowcoder.HJ84_B_统计大写字母个数;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = br.readLine()) != null) {
            char[] chars = str.toCharArray();
            int count = 0;
            for (int i = 0; i < chars.length; i++)
                if (65 <= chars[i] && chars[i] <= 90) count++;
            System.out.println(count);
        }
    }
}
